package com.onlocation.receivers;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import com.onlocation.gui.Main;
import com.onlocation.services.LocatorService;
import com.onlocation.util.Logger;
import com.onlocation.util.PreferenceUtil;
import com.onlocation.util.Util;

/**
 * Author: Steve Carrell
 * Date: 5/15/12
 */
public class BootReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        Util.init(context);
        if (PreferenceUtil.doAutoStart()) {
            Logger.v("starting LocatorService", BootReceiver.class.getName());
            Intent startIntent = new Intent(context, LocatorService.class);
            context.startService(startIntent);
        }
    }
}
